package com.mervin.patterns.factory.simplefactory;

import com.mervin.patterns.factory.BadFruitException;
import com.mervin.patterns.factory.Fruit;

/***************************************
 * @Auther: mervin
 * @Date: 2020-04-17 00:21
 * @Description: 客户端调用
 ***************************************/
public class Client {

    public static void main(String[] args) {
        try {
            Fruit apple = SimpleFruitFactory.createFruit("apple");
            apple.grow(); // Apple is growing...
            Fruit pear = SimpleFruitFactory.createFruit("pear");
            pear.grow(); // Pear is growing...
        } catch (BadFruitException e) {
            e.printStackTrace();
        }
    }
}
